package com.saodisheng.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.saodisheng.model.SiteInfo;

public class SiteInfoInterceptor implements Interceptor {
	private SiteInfo siteDao = new SiteInfo().dao();
	@Override
	public void intercept(Invocation inv) {
		Controller c = inv.getController();
		SiteInfo siteInfo = siteDao.findFirst("select * from site_info where id=1");
		c.setAttr("siteInfo", siteInfo);
		inv.invoke();
	}
}
